Refactor few process of VirtualMachineManagerImpl and improve logs#4966
Conversation
8c69a60 to
10ee79b
Compare
|
Packaging result: ✔️ centos7 ✔️ centos8 ✔️ debian. SL-JID 549 |
| .append(broadcastUri) | ||
| .append("]") | ||
| .toString(); | ||
| return String.format("NicProfile {\"id\": %s, \"vmId\": %s, \"reservationId\": \"%s\", \"iPv4Address\": \"%s\", \"broadcastUri\": \"%s\"}", id, vmId, reservationId, iPv4Address, broadcastUri); |
There was a problem hiding this comment.
@GutoVeronezi why are you converting them into hand-written json?
|
@GutoVeronezi you've submitted many PRs which are the same class of PRs around log improvements and refactorings and changing the resource/vo/object Can you club all such PRs into a single PR with separate/individual commits? They make it difficult to review and test individually and take a lot of time and resources from reviewers and BO/lab. |
@rhtyd Most of But that is not the focus of the PR. The focus is improve logging of these classes, as they do not supply an appropriate context to make the operation feasible. About join all this PRs in only one (separated in commits): |
|
Here follow my 2cents. 1 - Number of PRs@rhtyd raised an interesting point regartding the quantity of PRs. I think that creating one issue to track these PRs would help on testing and reviewing them all. The idea would be to link any PR that fits this effort on enhancing log messages as well as keeping a track of each PR (merged, under review, draft, etc). 2 - Creating an log message patternI have been running 4.16-SNAPSHOT already with a couple of these toString() methods. Personally I am happy to see log messages with a pattern and holding solid information. Maybe we can find better formatations than the JSON like. However, I find them interesting as it is a globally understood pattern for anyone at IT. The biggest plus in adopting |
|
@rhtyd please let's make changes per PR as little as possible. smaller PRs are usually easier to review. Only when the code is very intertwined should we combine PRs into bigger ones. |
|
@DaanHoogland I've just shared my preference that is around optimising around reviewers' and lab resources time. One can get the same thing with a single PR with individual small commits that are easier to review (Github allows you to review each commit individually). The benefit of the latter is you save a lot of overhead in people's time in tracking/test, and on smoketest resources. @GutoVeronezi what you've raised is a valid issue, however, there was no discussion around a new standard/consistent format for people to follow for new code. For example and as a suggestion, instead of Here something to think about:
On the issue of context, frankly, any PR that is more than a 100 lines of changes is not going to get a thorough review for each and every line by 2xreviewers, it's simply not feasible at least for me and people I know. Instead, we use smoketests and other means (manual QA, design/architecture review, consistency/pattern of changes, ...) to validate such PRs. I would club all such PRs around the same initiative which in this particular case is around logging/refactoring improvements. Splitting the work around the same initiative in 10 different PRs camouflaging under different |
10ee79b to
d3a80ce
Compare
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ centos7 ✔️ centos8 ✔️ debian. SL-JID 269 |
|
Trillian test result (tid-2053)
|
|
Trillian test result (tid-2055)
|
|
Trillian test result (tid-2054)
|
|
Thanks for reviewing @rhtyd I see your points - opening for discussion @GutoVeronezi @sureshanaparti @rhtyd @GabrielBrascher I think we all agree this PR will need some extensive testing for regressions on VM lifecycle operations. A good sign is that smoke tests are returning good results. Given that we are close to cutting the RC, do you think we can complete all the required testing in time for 4.16? |
|
@nvazquez General comment - closer to an RC you want to exclude any non-essential PRs you aren't confident on wrt stability and potential regressions. We can move such PRs to merging right after cutting the RC, and move them to the next major or minor release which should give enough time for community to test the changes until the next major/minor release. |
|
@rhtyd makes sense, thanks. If no objections let's move this PR to the next milestone to prevent unexpected regressions close to the RC cut date |
|
@nvazquez @rhtyd does it make sense to move this to the milestone 4.16.1.0? it is not a new feature and was built for 4.16. |
|
Restart jenkins... |
|
Restart jenkins... |
|
@blueorangutan package |
|
@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 1757 |
|
@blueorangutan test |
|
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-2573)
|
…pache#4966) * Improve logs * Remove unnecessary comments * Use diamond inference * Fix some logs * Remove unnecessary unboxing * Create method to handle job result * Remove unused vars and fix some logics * Extract code to method and few adjusts * Use CollectionUtils * Extract pending work job validation to method * Create new constructors * Extract work job and info creation to a method * Extract submit async job to a method * Extract find vm by id to a method * Change log level from trace to debug * Remove unnused methods and add logs * Undo code remotion * Remove asserts and fix conditionals * Address @GabrielBrascher reviews * Remove double quotes from keys in manual json * Undo code remotion * Add object to log * Remove statement from try/catch * Implement toString with ReflectionToStringBuilderUtils * Fix errors related to merge main Co-authored-by: Daniel Augusto Veronezi Salvador <daniel@scclouds.com.br>
…pache#4966) (apache#211) * Improve logs * Remove unnecessary comments * Use diamond inference * Fix some logs * Remove unnecessary unboxing * Create method to handle job result * Remove unused vars and fix some logics * Extract code to method and few adjusts * Use CollectionUtils * Extract pending work job validation to method * Create new constructors * Extract work job and info creation to a method * Extract submit async job to a method * Extract find vm by id to a method * Change log level from trace to debug * Remove unnused methods and add logs * Undo code remotion * Remove asserts and fix conditionals * Address @GabrielBrascher reviews * Remove double quotes from keys in manual json * Undo code remotion * Add object to log * Remove statement from try/catch * Implement toString with ReflectionToStringBuilderUtils * Fix errors related to merge main Co-authored-by: Daniel Augusto Veronezi Salvador <daniel@scclouds.com.br> Co-authored-by: Daniel Augusto Veronezi Salvador <38945620+GutoVeronezi@users.noreply.github.com> Co-authored-by: Daniel Augusto Veronezi Salvador <daniel@scclouds.com.br>
Description
This PR intends to refactor a few process, like extract repeated code to methods, remove unnecessary logic... Of class
VirtualMachineManagerImpland improve logging to facilitate troubleshooting.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
How Has This Been Tested?
It has been tested locally on a test lab.